﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ComponentModel.DataAnnotations;

namespace Zatify.Domain.Data
{
    public partial class Business
    {
        public TimeSpan FromToday { get; set; }
        public TimeSpan ToToday { get; set; }
        public Boolean ClosedToday { get; set; }
        public String StatusToday { get; set; }
        public String HoursToday 
        {
            get
            {
                string result = "";
                if (StatusToday == "OPEN")
                    if (FromToday == ToToday)
                        result = "24H";
                    else
                        result = DateTime.Today.Add(FromToday).ToString("hh:mm tt") + " - " + DateTime.Today.Add(ToToday).ToString("hh:mm tt");
                
                return result;
            }
        }
        
        public IEnumerable<Category> Categories
        {
            get
            {
                Zatify.Domain.Concrete.ZatifyRepository _db = new Zatify.Domain.Concrete.ZatifyRepository();
                return _db.BusinessGetCategories(this.BusinessId);
            }
        }

        //public IEnumerable<BusinessReview> Reviews { get; set; }

        public BusinessHours BusinessHours { get; set; }

        public Nullable<Double> Distance { get; set; }
    }
}
